package org.iabako.shared.querydefinition.columndefinition;

import org.iabako.client.tools.Messages;
import org.iabako.shared.querydefinition.dto.QueryResultValueType;

import java.io.Serializable;

/**
 * Created by jose on 28/08/14.
 */
public enum PaymentColumnEnum implements ColumnDefinition, Serializable {
    scheduleDate("payment.scheduleDate", "result_table_payment_schedule_date", "columnMplus smalltable", null, null, null, QueryResultValueType.DATE),
    date("payment.date", "result_table_payment_date", "columnMplus smalltable", null, null, null, QueryResultValueType.DATE),
    comment("payment.comment", "result_table_payment_comment", "columnS", "commenticon", "commenticonempty", "payment_no_comment", QueryResultValueType.STRING),
    amount("payment.amount", "result_table_payment_amount", "columnL columnrigthalign smalltable", null, null, null, QueryResultValueType.DOUBLE),

    paymentMethod("payment.paymentMethod", "result_table_payment_method", "columnS", null, null, null, QueryResultValueType.STRING),

    //Transient field to show in invoice table
    invoiceNumber(null, "result_table_payment_receipt_number", "columnleftalign columnMplus smalltable", null, null, null, QueryResultValueType.STRING),

    //To filter
    sale("payment.sale", null, null, null, null, null, null),
    saleClient("sale.client", null, null, null, null, null, null);

    private String hqlDefinition;
    private String labelKey;
    private String className;
    private String iconClassName;
    private String iconClassNameEmpty;
    private String textEmpty;
    private QueryResultValueType queryResultValueType;

    PaymentColumnEnum(String hqlDefinition, String labelKey, String className, String iconClassName,
                      String iconClassNameEmpty, String textEmpty, QueryResultValueType queryResultValueType) {
        this.hqlDefinition = hqlDefinition;
        this.labelKey = labelKey;
        this.className = className;
        this.iconClassName = iconClassName;
        this.iconClassNameEmpty = iconClassNameEmpty;
        this.textEmpty = textEmpty;
        this.queryResultValueType = queryResultValueType;
    }

    public String getHqlDefinition() {
        return hqlDefinition;
    }

    public String getHqlJoin() {
        return null;
    }

    public String getLabel() {
        return Messages.getLabel(labelKey);
    }

    public String getLabelKey() {
        return labelKey;
    }

    public QueryResultValueType getQueryResultValueType() {
        return queryResultValueType;
    }

    public int getExcelColumnWidth() {
        return 0;
    }

    public String getClassName() {
        return className;
    }

    public String getIconClassName() {
        return iconClassName;
    }

    public boolean isOnlyInExcelExport() {
        return false;
    }

    public String getIconClassNameEmpty() {
        return iconClassNameEmpty;
    }

    public String getTextEmpty() {
        return textEmpty;
    }
}
